<script setup lang="ts">
import {ref} from "vue";
import gfm from "@bytemd/plugin-gfm";
import highlight from "@bytemd/plugin-highlight";
import  { Editor } from "@bytemd/vue-next"



const value = ref()
const plugins = [
  gfm(),
  highlight()
]
interface Props {
  value: string
  mode?: string
  handleChange: (v: string) => void
}
const props = withDefaults(defineProps<Props>(), {
  value: () => '',
  mode: () => 'split',
  handleChange: (v: string) => {
    console.log(v)
  }
})
</script>

<template>
  <Editor :value="value" :mode="mode" :plugins="plugins" @change="handleChange" />
</template>

<style scoped lang="less">

</style>
